<div class="layui-fluid nepadmin-pad0 nepadmin-mar0 list0" id="list-select">
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card" style="box-shadow: none;">
          <div class="layui-card-body">
            <table class="layui-hide" id="list-select-table" lay-filter="list-table"></table>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="form-btn" style="bottom: -20px;">
	<input type="button" value="确认选择" class="layui-btn selectok">
 </div>
<script>
   //表格数据渲染
  layui.use(['table','form'], function () {
	  var table = layui.table
	  ,form = layui.form
	  ,$ = layui.$;
	  layui.admin.initlist(table,'device/list',195,[[
		{type:'checkbox'}
        ,{field:'device_id', title: 'ID', width:60}
        ,{field:'device_name', title: '设备名称', width:200}
        ,{field:'device_sn', title: '设备编号', width:200}
        // ,{field:'device_desc', title: '设备信息', minWidth:200}
        ,{field:'create_time', title: '创建时间', width: 200}
      ]],'#list-select-table',460,'','',{obj:layui.admin.task.device_ids,val:'device_id'})
	  
	$('.selectok').click(function(){
		var checkStatus = table.checkStatus('list-select-table')
		,checkData = checkStatus.data,ids,idss,names,namess;
		//ids=layui.admin.task.device_ids;
		for(var i=0; i<checkData.length;i++){
			if(ids){
				ids+=','+checkData[i].device_id;
				names+=','+checkData[i].device_name;
			}else{
				ids=checkData[i].device_id;
				names=checkData[i].device_name;
			}
		}
		if(!ids){
			layui.admin.ahint(2,'请选择设备');
		}else{
			layui.admin.task.device_ids=ids;
			layui.admin.task.device_names=names;
			layer.close(layui.admin.pups);
		}
	});
  });
</script>